<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Tools/AdminPartner/index')}">合作伙伴列表</a></li>
			<li class="active"><a href="{:U('Tools/AdminPartner/add')}">添加编辑合作伙伴</a></li>
		</ul>

		<form class="form-horizontal js-ajax-form" method="post" action="" enctype="multipart/form-data">
			<input type="hidden" name="partner_id" value="{$partner['partner_id']}">

			<div class="row-fluid">
				<div class="span9">



					<div class="control-group">
						<label class="control-label" for="input-catename">合作伙伴分类</label>
						<div class="controls">

							<select name="partner_cid">
								<option value="">请选择合作伙伴</option>

								<foreach name="select_cates" item="vo">
								<if condition="($vo['cate_id']) eq ($partner['partner_cid'])">
										<option value="{$vo.cate_id}" selected="selected">{$vo.cate_name}</option>
								    <else />
										<option value="{$vo.cate_id}">{$vo.cate_name}</option>
								</if>
								</foreach>
							</select>
						</div>
					</div>

					<div class="control-group">
						<label class="control-label" for="input-catename">合作伙伴名称</label>
						<div class="controls">
							<input type="text" class="input-xlarge" id="input-catename" name="partner_name" value="{$partner['partner_name']}">
							<span class="help-block"></span>
						</div>
					</div>


					<div class="control-group">
						<label class="control-label" for="input-catename">合作链接</label>
						<div class="controls">
							<input type="text" class="input-xlarge" id="input-catename" name="partner_url" value="{$partner['partner_url']}" />
							<span class="help-block"></span>
						</div>
					</div>


					<div class="control-group">
						<label class="control-label" for="input-orderby">排序</label>
						<div class="controls">
							<input type="text" class="input-xlarge" id="input-orderby" name="orderby" value="{$partner['orderby']}" placeholder="">
							<span class="help-block">数字越小排序越靠前</span>
						</div>
					</div>
				</div>
				<div class="span3">

						<table class="table table-bordered">
							<tr>
								<th>缩略图</th>
							</tr>
							<tr>
								<td>
									<div style="text-align: center;">
										<input type="hidden" name="partner_pic" id="thumb" value="" />
										<a href="javascript:upload_one_image('图片上传','#thumb');">

											<if condition="empty($partner.partner_pic)">
												<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand"/>
											<else />
												<img src="{:sp_get_image_preview_url($partner['partner_pic'])}" id="thumb-preview" width="135" style="cursor: hand; height: 113px;"/>
											</if>



										</a>
										<input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片" />
									</div>


								</td>
							</tr>
						</table>

				</div>
			</div>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary  js-ajax-submit">保存</button>
				<a class="btn" href="javascript:history.back(-1);">返回</a>
			</div>
			</fieldset>
		</form>


	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>
